package com.etc.service;

import com.etc.entity.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Component
@FeignClient(value = "cloud-nacos-update")
public interface UpdateService {
    //修改楼栋信息
    @RequestMapping("building/update")
    public CommentResult updateBuilding(@RequestBody Building building);

    //修改房间信息
    @RequestMapping("room/update")
    public CommentResult updateRoom(@RequestBody Room room);

    @RequestMapping("room/buyRoom/{owner_id}/{id}")
    public CommentResult buyRoom(@PathVariable("owner_id")Integer owner_id, @PathVariable("id")Integer id);

    @RequestMapping("room/sellRoom/{id}")
    public CommentResult sellRoom(@PathVariable("id")Integer id);

    //修改小区信息
    @RequestMapping("park/update")
    public CommentResult updatePark(@RequestBody Park park);

    //修改业主信息
    @RequestMapping("owner/update")
    public CommentResult updateOwner(@RequestBody Owner owner);

    //修改公告信息
    @RequestMapping(value = "infobar/update",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public CommentResult updateInfobar(@RequestPart(value = "file",required = false) MultipartFile file,
                                       @RequestParam("id")Integer id,
                                       @RequestParam("info") String info,
                                       @RequestParam("park_id")Integer park_id,
                                       @RequestParam("upload_date")String upload_date);

    @RequestMapping("infobar/updateNoFile")
    public CommentResult updateNoFile(@RequestParam("id")Integer id,
                                      @RequestParam("info") String info,
                                      @RequestParam("park_id")Integer park_id,
                                      @RequestParam("upload_date")String upload_date);

    //修改维修设备信息
    @RequestMapping("device/update")
    public CommentResult updateDevice(@RequestBody Device device);

    //修改住户信息
    @RequestMapping("household/update")
    public CommentResult updateHousehold(@RequestBody Household household);

    //修改缴费信息
    @RequestMapping("payment/update")
    public CommentResult updatePayment(@RequestBody Payment payment);

    @RequestMapping("payment/changeStatus")
    public CommentResult changeStatus();
}
